<template>
  <el-container style="height:100vh; display: flex;">
    <el-aside :width="isCollapse ? '64px' : '200px'" style="background-color:#304156;">
      <Aside :is-collapse="isCollapse"/>
    </el-aside>

    <el-container direction="vertical" style="flex:1;">
      <el-header height="60px" style="background:#fff;border-bottom:1px solid #e6e6e6;">
        <Header @do-collapse="doCollapse" :icon="icon"/>
      </el-header>

      <el-main style="flex-grow:1;background:#f1f1f3;">
        <router-view/>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import Aside from '@/components/Aside.vue'
import Header from '@/components/Header.vue'
export default {
  components: { Aside, Header },
  data() {
    return {
      isCollapse: false,
      icon: 'el-icon-s-fold'
    }
  },
  methods: {
    doCollapse() {
      this.isCollapse = !this.isCollapse
      this.icon = this.isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'
    }
  }
}
</script>
